﻿using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;

namespace Api
{
    /// <summary>
    /// 测试service
    /// </summary>
    public  class TestService
    {
        public string card_no = new IniFile(System.Environment.CurrentDirectory + "/card.ini").IniReadValue("Test", "card_no");       
        /// <summary>
        /// 进闸机 刷卡
        /// </summary>
        [Test]
        public void inSwipeCard() {
        
            Console.WriteLine(System.Environment.CurrentDirectory + "/card.ini");//注意配置文件第一行要是空行                     
            Console.WriteLine("=========card_no=======" + card_no);
            Dictionary<string, object> o = ApiService.inSwipeCard(card_no, "1");
            Console.WriteLine("=========flag=======" + o["flag"].ToString());
            Console.WriteLine("=========data=======" + o["data"].ToString());
            Console.WriteLine("=========is_open=======" + o["is_open"].ToString());
        }
        /// <summary>
        /// 出闸机  刷卡
        /// </summary>
        /// 
        [Test]
        public void outSwipeCard() {
            Dictionary<string, object> o = ApiService.outSwipeCard(card_no, "4");
            Console.WriteLine("=========flag=======" + o["flag"].ToString());
            Console.WriteLine("=========data=======" + o["data"].ToString());
            Console.WriteLine("=========is_open=======" + o["is_open"].ToString());
        }
        /// <summary>
        /// 指纹验证回掉
        /// </summary>
        /// 
        [Test]
        public void swipeFingerPrintResult() {
            ApiService.swipeFingerPrintResult(card_no, true, "4");
        }
        [Test]
        public void timeTest() {
            Console.WriteLine(GetTimeStamp());
        }
        public static long GetTimeStamp()
        {

            TimeSpan ts = DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, 0);
            return Convert.ToInt64(ts.TotalSeconds * 1000);
        }
        /// <summary>
        /// 刷储物柜
        /// </summary>
        [Test]
        public void swipeLockers() {
            Dictionary<string, object> o = ApiService.swipeLockers("A5A8B3C1", "10001");
            Console.WriteLine("=========flag=======" + o["flag"].ToString());
            Console.WriteLine("=========data=======" + o["data"].ToString());
            Console.WriteLine("=========is_open=======" + o["is_open"].ToString());
        }
        /// <summary>
        /// 根据卡片号码  查询储物柜信息
        /// </summary>
        [Test]
        public void getLockersByCardNo()
        {
            for (int i = 0; i < 2; i++)
            {
                var o = ApiService.getLockersByCardNo("123456789" + i);
                Console.WriteLine("=========flag=======" + o["flag"].ToString());
                Console.WriteLine("=========data=======" + o["data"].ToString());
                Console.WriteLine("=========is_open=======" + o["is_open"].ToString());
            }
          
        }
        [Test]
        public void test_post()
        {
             string postString = "v=1.0&t=1498528957&key=zwzl_admin&sign=1c227030322aeba795ed592e7162fe55&id_number={0}&&start_date=2017-06-27 09:58:38&effect_date=2018-06-26 09:58:38&surplus=50&in_varifycation=0&out_varifycation=0&in_surplus_limt=1&in_surplus_sub=1&status=1&mobile=18335112355&name=小张&files=/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCAEYAOwDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dX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f84pyWkKJsAO30J+v+NAB9qjMjR4bKttzjjPH+P86bLcxwrIfLJ2n5sD8KcLSILgBhxjO457frwKGtImXa245OSSeTzmgCAalE1us/luQTheB7f41ZhdJ4xIF4PAyKjksYZBg7gNxY7TjJ606OGKAqBIflBwC3qaAIJ9RhtrjyTG249wBinC9haYIEYkOVLbeh6U24tLSa5EksmJAcAbwP0p32a2NxuEn7wHOAw9aAHfaVyf3LblByOMgf5xxSi5TOEhYlvuAY+YetNWK2CCMTZ2gn7/ADg9c+3FO8mAbiJCCp6hvue3t1oARrmDyXZVDkJvMYxk5psN9FOkjCNgFODuwM5/GpCls8O0Mm1gFyCOR2FMigtbeP8AdSCNW5BD9f8AOaAFkuY0iWQxFhnAxtP65xQ11ENgERYsMgADpnHrTysfylpzxyuWHU9D/OmtZRsuCz9Mdfr/AI0ANe+jjIAjbBGePpmnfakMpj8tuuM8UPYwvksCWP8AFxnpil+xxb9/IYtknA5/T2oAhj1GJ3kxEwKDJJxzimxapbyRtL5bKAQCSB1JA/wqVdOgQsV3AuMMc9f8PwpVsIUBA3YPYnpzmgCSGSOcMQgGDg9DU3QYFRxQJDnbnnqTUlABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAVWuIJJHO3aVIAILEHg54qzRQBmXWnPPMsg2DaRgEk+nf86aNKYXv2ncMF2bb3GeOv8AStWigDJXS5QpUsm0qV75HA5z+B/OpVsH8tlY4JxgbyR97P5Vo0UAZz6ezx7cIATkjp+uPSnmzZo1XO3584BHAyPb2q9RQBRexf7Q8qsGJjC/MfTp2/WroztGcZxzilooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigD/9k=";
             postString=String.Format(postString, DateTime.Now);
            byte[] postData = Encoding.UTF8.GetBytes(postString);//编码，尤其是汉字，事先要看下抓取网页的编码方式  
            string url = "http://zwzl.ocmcom.com/api/InterfaceApi/add";//地址  
            WebClient webClient = new WebClient();
            webClient.Headers.Add("Content-Type", "application/x-www-form-urlencoded");//采取POST方式必须加的header，如果改为GET方式的话就去掉这句话即可  
            byte[] responseData = webClient.UploadData(url, "POST", postData);//得到返回字符流  
            string srcString = Encoding.UTF8.GetString(responseData);//解码  
            Console.WriteLine(srcString);

        }



    }
      
}
